package com.wjq.service;

import org.springframework.stereotype.Service;

import com.wjq.entity.User;
import com.wjq.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserMapper userMapper;

    /**
     *
     * @param name, password
     * @return 用户名和密码
     */
    @Override
    public User Check(String name) {
        User user = userMapper.selectUserByUsername(name);
        return user;
    }

    /**
     *
     * @return所有用户对象
     */
    public List<User> getUserList(){
        List<User> users = userMapper.queryUserList();
        return users;
    }

    @Override
    public User selectUserByUsername(String username) {
        return userMapper.selectUserByUsername(username);
    }


}
